package sixth;
class Person2{
    void print(){
        System.out.println("Person.......");
    }
}
class Student2 extends Person2{
    public void print(){
        super.print();//调用父类的方法
        System.out.println("Student.......");
    }
}
public class 调用父类中被子类覆写过的方法 {
    public static void main(String[] args) {
        new Student2().print(); //此处执行被覆写过的方法
    }
}
/*
D:\WorkSpaces\Java\jdk-21\bin\java.exe "-javaagent:D:\Software\IntelliJ IDEA\IntelliJ IDEA 2023.3.2\lib\idea_rt.jar=62825:D:\Software\IntelliJ IDEA\IntelliJ IDEA 2023.3.2\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath D:\WorkSpaces\JavaDevelopBase_start_329\out\production\JavaDevelopBase_start_329 sixth.调用父类中被子类覆写过的方法
Person.......
Student.......

Process finished with exit code 0
 */
